#include "../skyCanvas.h"
#ifdef WIN32
namespace Sky
{
Sky::NType::TBool Sky::Canvas::create( TInt w,TInt h,TInt Format_ ,TUint subFormat)
{
	_pict = skynew (Pict());
	xPict* mPict = _pict->getPict();
	mPict->setUsage(D3DUSAGE_RENDERTARGET);
	mPict->setType(xPict::Type_Normal);
	mPict->setWidth(w);
	mPict->setHeight(h);
	return XE_OK == mPict->trySelfCreate();
}

Sky::NType::TBool Canvas::attachPicture(  )
{
	_canvas.Attach(_pict->getPict());
	return vTrue;
}

Sky::NType::TVoid Canvas::detachPicture()
{
	_canvas.Detach();
}
}
#endif
